//
//  AppDelegate.swift
//  MVVM微博
//
//  Created by AppleDev on 2017/7/15.
//  Copyright © 2017年 AppleDev. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        window = UIWindow()
        window?.backgroundColor = #colorLiteral(red: 0.1411764771, green: 0.3960784376, blue: 0.5647059083, alpha: 1)
        window?.makeKeyAndVisible()
        
        window?.rootViewController = ZLMainViewController()
        
        return true
    }
}

extension AppDelegate{
    
    fileprivate func loadAppInfo(){
        
        DispatchQueue.global().async { 
            
            let url = Bundle.main.url(forResource: "main.json", withExtension: nil)
            
            let data = try? NSData(contentsOf: url!, options: [])
            
            let path = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
            let jsonPath = (path as NSString).appendingPathComponent("main.json")
            data?.write(toFile: jsonPath, atomically: true)
            
            
            
            
            
            
        }
        
        
    }
    
    
}
